flThe purpose of this tutorial is not to give you an example of every possible thing you can do with Divinity. That would be nearly impossible. However, it will give you examples of each code and the basics of how it works. flThe purpose of this tutorial is not to give you an example of every possible thing you can do with Divinity. That would be nearly impossible. However, it will give you examples of each code and the basics of how it works. ıCode = 1 just displays a string. This is string #2 you are reading right now. If you put a negagive (-) in front of the string ID then it will display without waiting for the player to click the mouse. The next string is just such an example. ıThis string was just displayed and did not wait for the player to hit the mouse button before moving on to the next code in the script. The next code in the script played a sound. That is why you heard a sound right after the string was shown. ÈCode = 2 will send the player to a battle. You can make this a simple battle or make it one of a random set of battles. Putting a negative in front of the battle ID # will cause the party to be surprised. This is a simple batttle. ñThis is an example of the party getting surprised. It is battle #1 but since a -1 is used in the extended codes it causes the player to be surprised. ˇThis is an example of how to send the party to a random battle. It will randomize a battle between battles #1 through Battles #3. In addition, it will play sound 30001 before the battle (A growl) and will only award VICTORY POINTS. The player will NOT ˙Code = 3 allows for a simple branch depending on whether the player clicks Yes/No or on the Left/Right chioces. This example is a simple Yes/No question. If they answer Yes it will continue with the script. If they answer No it will back them up. ∑In this example, it will give them two choices. The string #s of the two choices are specified. The branch testing is the same as if the left side was YES and the Right side was NO. Choice #1 (YES) Choice #2 (NO) ÓThis is exactly the same as the previous example only instead of backing the party up if they answer NO it will branch them to an Extra Action Point. There you can script it to do whatever you want. In this case it sends them to X-AP #0 üYou could just as easily send them to a simple or complex encounter instead of the X-AP. It 's up to you as the branch action is specified in the extra codes. vCode = 4 sends the part to a simple encounter. Code 4 has no options. This example sends them to Simple Encounter #0 ÓThis is the prompt string used in simple encounter #4. It will be displayed each time this simple encounter is offered to the player. In this example it will offer 3 choices. After they pick 3 times it will timeout and go to result #4. You picked Option #1 You picked Option #2 You picked Option #3 ÆYou have picked 3 times. This encounter is designed to timeout after 3 picks. After 3 picks it defaults to Result #4. This message was displayed from the Result #4 script. ÊCode = 5 will send the party to a complex encounter. These are far and away the hardest things to script. These examples will not get too hairy as it is best learned by experience. This will now send you to Complex Encounter #0 ΩCode 6 activates a shop. The SHOP ID is placed in the ID section. You can have up to 20 shops in each game and each keeps track of which items it has. This example sends you to shop ID 1 ’Code = 7 can be used to change the script of any action point, X-AP or simple or complex encounter result script. It will most often be used the chage the script of a standard AP so we will demonstrate this here. gDepending on which well you walk on first it will change what happens when you walk on the second well. ¨You just walked on this well first. I know this because if you would have walked on the other well, it would have changed this script to say you walked on this one second. $You just walked on this well second. ¯Code = 8 lets you script a lot of action points to be identical to just one. This can save a lot of time and headache. This action points just prints this text. The two below examples will also do the same as they use code 8 to mimic this one. $This script has continued executing. ¡Code = 9 just plays a sound. The ID of the sound is played without waiting for any other action. If the ID is negative then it will play and stop executing codes until the sound is completed. ^Play with a delay will happen next. After the sound plays the script will contiue to execute. dCode = 10 Gives a treasure. This is treasure #1 It consists of 2 daggers and a Robe of the Magi +2 ´You can also give victory points as well as wealth. This example gives 1000 victory points as well as a random amount from 1 to 500 gold, 10 gems and 2 pieces of jewelry. sCode = 11 will award just victory points. This is a quick way to award points without having to create a treasure. ÉCode = 12 will allow you to change land tiles. This example will place a tile of water a few steps south of your current position. ƒCode 13 will alow you to enable or disable action points. In this example, the well below will cause a battle. However, if you walk on the bush it will deactivate the action point over the well. EAction Point 21 deactivated. The well will no longer cause a battle. ØAll victory points are subject to change according to the difficulty of the game. i.e. If the player is playing at 50% difficulty, the amount awarded will be reduced by 50%. ’Code = 14 will allow you to pick characters. The idea of picking characters is you can later execute codes that only affect characters that are picked. In this example, you will be required to pick 2 characters. ‡If a code -14 is encountered. It will reverse the pick. In this case it will ask you to pick one character. It will then actualy PICK all other characters. This lets you execute codes on those the character did NOT pick. ‹Code = 15 allows you to heal or damage any characters that are picked. In this case, if you just performed code 14 it would have had you pick 2 characters. It then reversed the pick so those were the only 2 NOT picked. ÷We will now DAMAGE each picked character a random amount from 2 to 12 points. This is done by setting the multiplyer to -2 and setting the amount from 1 to 6. This simulates damage as if it were 2 six sided dice. ÂCode = 16 works exactly like code 15. The only change is instead of healing or hurting those that are picked, it does the healing/damage to each character in the party. In this case we will heal each member from 2 to 12 points. ôNow that you picked 2 characters. Lets do a code 15 which can heal/hurt all those picked. In this case we will heal each from 2 to 12 points of damage. ˚Now that you picked 1 character the game unpicks that character and then picks all the others. That is because this was a -14 code. Lets do a code 15 which can heal/hurt all those picked. In this case we will heal each from 2 to 12 points of damage. ˘Code = 17 will cast a spell on each picked character. First we will pick 2 characters and then we will cast a spell on them. In this case we will cast spell 1102 which is Enchanted Blade. We will cast it at power level 7 on each picked character. £Code = 18 will cast a spell on each party member. In this case we will cast spell 1302 which is Adrenalin. We will cast it at power level 7 on each party member. —Code = 19 will display a random string between a set range of string numbers. Example: Say you define strings 1 through 10 to have a random hint. You can use this to have a crystal ball give a random hint. MIn this case it will display a random string from string # 47 to string # 50. .String # 47 used in the random string example. .String # 48 used in the random string example. .String # 49 used in the random string example. .String # 50 used in the random string example. ˛Code = 20 will move the party to a specific location. If the new location is an action point, it will load the script for that action point and begin executing the script for the new action point. In this example we will teleport you to the gravestone. uYou just landed on the gravestone and this strings is displayed as part of the action point placed on the gravestone. ÓCode = 21 will branch depending on whether somebody in the party has a specific item or not. In this case, if anybody has the dagger "Frozen Viper" the mushroom clump below will branch you to X-AP #2. If not it will continue its script. âYou can get a viper at the hole next to the mushroom. Try walking on the clump first and then get the frozen viper and walk on it again. Checking for Frozen Viper. 4You did not have it so we continued with the script. ìYou had the Frozen Viper. This message is displayed as part of the script in X-AP #2. You were branched to this X-AP as part of the code 21 test. ŸCode = 22 can alter the status of an item if the party has it. In this case, if you still have the Frozen Viper this action point will check for it and change all Frozen Vipers (Item #9) into item #1 (Normal Dagger). TYou have just walked south of walled in area. This area is CRAWLING WITH BROWNIES. —Code = 23 can alter some aspects of a random rectangle. In this case, the area just south of the walled in section is Crawling with Brownies. It is actually just activating random rectangle #1 that is there. ≥If you walk over the left gravestone it will deactivate that rectangle by setting the Times in 10,000 to 0. The right gravestone will re-activate it by setting it back to 10,000. #Random Rectangle #1 is reactivated. #Random Rectangle #1 is deactivated. ÛCode = 24 marks an action point to be kept around after it is done executing. In almost every example we have seen up to this point, the action point ended with a code 24. This allows you to walk over those action points over and over again. ¸Code = 24 marks an action point to be erased after it's done executing. This is the default action for any action point after the script has finished executing. In a few special situations a code 25 can be handy but you will not need to use them much. ÎThis action point ends with a code 25. When the script is done it will delete itself. In the mushroom patch below there is another action point with no code 25. It will still delete itself by default unless a code 24 is encountered. xThis is the test action point. It will now delete itself as the script is finished and no code 24 has been encountered. –Code = 28 will just center the screen. This code is largely obsolete now. It was used in a very old version. However, I have left it in as you never know when something as simple as this may come in handy. ‰Code = 26 will just prompt the player to hit the mouse button. This lets you make the player pause to think about something. By and large though this is an obsolete code but may still have some use to somebody so I left it in. ıCode = 27 lets you display a picture. The most often use of this in a Realmz scenario was to show the splash screen for the scenario when you began a new game. Due to space limitations and download sizes we did not use a whole lot of pictures. ˝However, many of you out there may fancy yourself the starving artist and may want to flash all kinds of pictures around. If that is the case code 27 lets you do that. Using ResEdit you can place the Pictures in the resource fork of the scenario file. πand then flash them on the screen as part of the script. For more info on how to install your pictures for use see the manual. We will now flash a picture on the screen as an example. îCode = 29 lets you give maps to the party. In this case we will give you map number 1 which should show the area around the start of this tutorial. ÒCode = 30 lets you pick characters depending on whether or not they made a check vs. a special ability. In this example we will make a check on each characters ability to detect trap. All those that fail will fall in a pit and take damage. ÁSince the check is for a success and we want to pick those that fail, we need to put the special ability checked for as a negative. In this case we want to check for special ability 6. So we put in -6 to pick all those that fail. ∞O.K. We just performed the check. Now we will give 1-12 damage to each that failed. If any of your characters took damage it will mean they failed the Check vs. Detect Trap. ˙Code = 31 lets you branch on a check vs. special ability. This is similar to code 30 only instead of picking characters it will branch to an X-AP depending on whether or not a character is successful. One character is picked for testing by default. üIn this case, we will do a check vs. Disarm Trap. If the character fails we will branch to an X-AP that would deal with it as if a chest exploded or whatever. ZYour character was successful. You open the chest and inside you find........... NOTHING! `Your character failed. You open the chest and inside you find only horrible pain and suffering. ÃCode = 32 will activate the temple button. You specify the inflation rate (100 = normal prices, 200 = Double prices etc.) as the ID. In this case we will send you to a temple that has 150% normal prices. ›Code = 33 allows you to take gold or gems from the party. Depending on the options you specify you can continue/stop the script or branch the party to an encounter or X-AP depending on whether or not they have the money. ˇIn this case, you will be asked for 5000 gold. If you have it then it will continue with the script. If not it will just stop executing the script. This code can be very tricky as it has a lot of options. It lets you branch around inside an encounter ∑i.e. If you place code 33 in the Result #1 of a simple encounter you could branch to Result #3 and even start executing the script part way down. Our example however is very simple. ˙Code = 34 lets you break an encounter loop. You can set your encounters to just keep asking the player for a choice. However, there may be a time when you want to just bust out of the encounter all together without fear of what the script might do. kThis code is really only for use in the Results of the Simple and Complex Encounters and is not often used. –Code = 35 lets you eliminate an encounter choice. Simple encounters give you up to 4 choices you can give the player. This code lets you erase one of those choices. This is only used in simple encounters. —The below clump of mushrooms has a simple encounter. Each time you make a choice, a code 35 will be used to ease the choice you just made. After 3 choices it will default to result #4 and exit the encounter. ØMake any choice you want. After you do, that choice will be eliminated and you can choose again. After 3 choices it will default to result #4 and exit this simple encounter. ˆCode = 66 will let you enable or disable the ability for the party to camp. As an example, if want the party not to camp inside a city, put a Code 66 ID 1 as they enter the city. When they leave, execute a Code 66 ID 0 to let them camp again.